var express=require('express');//导入express(http框架)
var app=new express();//实例化express
var user = require('./router/user')
var stock = require('./router/stock')

app.use('/user',user);
app.use('/stock',stock)

app.use('/public',express.static('public')) // 路由的父级路径，相对路径

var server = app.listen(3000,'localhost',function () {
    var host = server.address().address;
    var port = server.address().port;
    console.log("这个服务的访问地址是 http://%s:%s",host, port);
})// 通过监听3000,建立一个服务器

